package leecode

import "unicode"

func greatestLetter(s string) string {
	hashMap := make(map[rune]bool)
	for _, str := range s {
		hashMap[str] = true
	}
	var result string
	for i := 'Z'; i >= 'A'; i-- {
		if hashMap[i] && hashMap[unicode.ToLower(i)] {
			return string(i)
		}
	}
	return result
}
